package com.xiaoxing.paimai.di.module;

import com.jess.arms.di.scope.ActivityScope;

import dagger.Module;
import dagger.Provides;

import com.xiaoxing.paimai.mvp.contract.ScanQRCodeContract;
import com.xiaoxing.paimai.mvp.model.ScanQRCodeModel;


@Module
public class ScanQRCodeModule {
    private ScanQRCodeContract.View view;

    /**
     * 构建ScanQRCodeModule时,将View的实现类传进来,这样就可以提供View的实现类给presenter
     *
     * @param view
     */
    public ScanQRCodeModule(ScanQRCodeContract.View view) {
        this.view = view;
    }

    @ActivityScope
    @Provides
    ScanQRCodeContract.View provideScanQRCodeView() {
        return this.view;
    }

    @ActivityScope
    @Provides
    ScanQRCodeContract.Model provideScanQRCodeModel(ScanQRCodeModel model) {
        return model;
    }
}